﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Szakdolgozat.Screens;
using System.Collections.ObjectModel;

namespace Szakdolgozat
{
    /// <summary>
    /// Interaction logic for MainMenuView.xaml
    /// </summary>
    public partial class MainMenuView : UserControl
    {
        MainWindow mainWindow;
        Controller controller = new Controller();
        ObservableCollection<Controller.Data> List;

        public MainMenuView(MainWindow mainWindow)
        {
            List = new ObservableCollection<Controller.Data>();
            this.mainWindow = mainWindow;
            InitializeComponent();
        }

        // Log in ablakra való átváltás
        private void logoutButton_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.contentControl1.Content = new LoginView(mainWindow);
        }

        // Measurement ablakra való átlépés
        private void measureButton_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.contentControl1.Content = new MeasureView(mainWindow);

        }

        private void settingsButton_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.contentControl1.Content = new SettingsView(mainWindow);
        }

        private void databaseButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (var item in controller.GetResults())
            {
                this.List.Add(item);
            }
            mainWindow.contentControl1.Content = new DatabaseView (mainWindow, List);
        }

   }
}
